home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
The Best of BMUG
/
Utilities
/
Text and Speech
/
Alpha.5.76
/
Tcl
/
SystemCode
/
filesetMenu.tcl
< prev
next >
Wrap
Text File
|
1994-03-08
|
745b
|
30 lines
#================================================================================
# Create a heirarchical fileset menu that allows you
# to open any file in any fileset.
#
# Doesn't bother trying to specialcase names or pathnames that have
# non-alphanumeric characters in them.
proc filesetProc {menu item} {
global fileSets
if {[set match [lsearch $fileSets($menu) *:$item]] >= 0} {
edit [lindex $fileSets($menu) $match]
}
}
proc makeFilesetMenu {} {
global fileSets
foreach f [lsort [array names fileSets]] {
if {$f == "Help"} continue
set menu {}
foreach m $fileSets($f) {
lappend menu [file tail $m]
}
lappend sets [list menu -m -n $f -p filesetProc $menu]
}
menu -n files -p filesetProc $sets
}
makeFilesetMenu